﻿using System.Windows.Controls;
using GalaSoft.MvvmLight.Messaging;
using Songhay.Mvvm.Models;

namespace Songhay.Silverlight.BiggestBox.AdditionalSamplesPart.Views
{
    /// <summary>
    /// Telerik Radial Gauge Sample
    /// </summary>
    public partial class TelerikRadialGaugeCustomizedSample : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TelerikRadialGaugeCustomizedSample"/> class.
        /// </summary>
        public TelerikRadialGaugeCustomizedSample()
        {
            InitializeComponent();

            Messenger.Default.Register<LightMessage<double>>(this,
            message =>
            {
                if(message.Source != LightMessageSource.ViewModel) return;
                if(message.UniqueId != "TelerikRadialGaugeSample") return;
                this.Needle.Value = message.Content;
            });
        }
    }
}
